//
//  QiMingADKitLogging.h
//  QiMingADKit
//
//  Created by 陈坤 on 2020/3/19.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, QiMingADKitLogLevel) {
    /// No logs
    QiMingADKitLogLevelOff     = 0,
    /// Error logs only. 0...00001
    QiMingADKitLogLevelError   = (1 << 0),
    /// Error and warning logs, 0...00010
    QiMingADKitLogLevelWarning = (1 << 1),
    /// Error, warning and info logs, 0...00100
    QiMingADKitLogLevelInfo    = (1 << 2),
    /// Error, warning, info and debug logs, 0...01000
    QiMingADKitLogLevelDebug   = (1 << 3),
    /// Error, warning, info, debug and verbose logs, 0...10000
    QiMingADKitLogLevelVerbose = (1 << 4),
    /// All logs. 1...11111
    QiMingADKitLogLevelAll     = NSUIntegerMax
};

QiMingADKitLogLevel QiMingADKitLogGetLevel(void);
void QiMingADKitLogSetLevel(QiMingADKitLogLevel level);

FOUNDATION_EXPORT void _QiMingADKitLogError(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADKitLogWarn(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADKitLogInfo(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADKitLogDebug(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADKitLogVerbose(NSString *format, ...);

#ifdef DEBUG
    #define QiMingADKitLogError(...)   _QiMingADKitLogError(__VA_ARGS__)
    #define QiMingADKitLogWarn(...)    _QiMingADKitLogWarn(__VA_ARGS__)
    #define QiMingADKitLogInfo(...)    _QiMingADKitLogInfo(__VA_ARGS__)
    #define QiMingADKitLogDebug(...)   _QiMingADKitLogDebug(__VA_ARGS__)
    #define QiMingADKitLogVerbose(...) _QiMingADKitLogVerbose(__VA_ARGS__)
#else
    #define QiMingADKitLogError(...)   _QiMingADKitLogError(__VA_ARGS__)
    #define QiMingADKitLogWarn(...)    _QiMingADKitLogWarn(__VA_ARGS__)
    #define QiMingADKitLogInfo(...)    _QiMingADKitLogInfo(__VA_ARGS__)
    #define QiMingADKitLogDebug(...)   _QiMingADKitLogDebug(__VA_ARGS__)
    #define QiMingADKitLogVerbose(...) {}
#endif
